<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<% String path = request.getContextPath(); request.setCharacterEncoding("UTF-8");
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">   
<head>
<base href="<%=basePath%>">
<title>车险保单查询</title>
<jsp:include page="/WEB-INF/jsp/common/common.jsp"></jsp:include>	
<link href="css/calendar.css"  rel="stylesheet" type="text/css" >
<link rel="stylesheet" href="<%=path%>/css/zTreeStyle/zTreeStyle.css">
<script type="text/javascript" src="<%=path%>/js/jquery.ztree.core-3.5.js"></script>
<script type="text/javascript" src="<%=path%>/js/jquery.ztree.excheck-3.5.js"></script>
<script src="<%=path%>/js/jquery.divbox.js" type="text/javascript"></script>
<style type="text/css">
.sub-title {
    background: none repeat scroll 0 0 #ffffff;
    font-size: 100%;
    font-weight: bold;
    height: 30px;
    line-height: 30px;
    text-indent: 10px;
    width: 100%;
}
</style>
	<script language="javascript" type="text/javascript">
		var defaultBranch;//保存默认机构的值
		$(document).ready(function() {
			isReadyIframe();
			
			loadPrivilegeBranchSelect();//加载机构下拉框
		});
		
		function isReadyIframe(){
			var iframe = $(window.parent.document).find("#iframe").length;
			if(iframe==0){
				window.location.href="<%=basePath%>index.jsp";
			}
		}
		
		//加载机构下拉框
		function loadPrivilegeBranchSelect(){
			$.ajax({
					url : "<%=path%>/carPolicyList/queryPrivilegeBranch?"+new Date().getTime(),
					type : 'POST',
					async : false,
					dataType:'json',
					success : function(result) {
						if(result){
							if($.validate(result))return;

							//接口下拉框对象
							var privilegeBranchSelect = document.getElementById("privilegeBranch");
							privilegeBranchSelect.length=0;
							
							var data = result.data;
							if(data.length > 0){
								defaultBranch = data[0].deptCode;
									
								for (var i = 0; i < data.length; i++) {
									var option = new Option();
									option.text = data[i].deptCname;
									option.title = data[i].deptCname;
									option.value = data[i].deptCode;
									
									privilegeBranchSelect.add(option);
								}
							}
						}
					}
				});
		 }
		
		//所选机构改变时，清空相关联数据
		function clearBranchRelaField(){
			$("#dptCode").val("");
			$("#partnerNo").val("");
			$("#subPartnerNo").val("");
		}
		
		//------------------------------------------ 出单机构 开始----------------------------------------------
		//打开出单机构窗口
		function openDeptDiv(pageIndex,obj){
			
			if($.trim($('#privilegeBranch').val()).length == 0){
				$.message("error", "请先选择机构");
				return;
			}
			
			$('#deptCode').val('');
			$('#deptCname').val('');
			$("#"+obj.id).blur();
			queryCoreDept(pageIndex);
		}

		//查询出单机构
		function queryCoreDept(pageIndex){
			var size = 8;
			var deptCode = $.trim($('#deptCode').val());
			var deptCname = $.trim($('#deptCname').val());
			var parentDeptCode =  $.trim($('#privilegeBranch').val());
			
			$.openLoading();
			$.ajax({
				url : "<%=path%>/carPolicyList/queryDeptByDeptAndParentDeptCode",
				type : 'POST',
				async : true,
				data:{
					size:size,
					pageIndex:pageIndex,
					deptCode:deptCode,
					deptCname:deptCname,
					parentDeptCode:parentDeptCode
				},
				dataType:'json',
				success:function(page){
					$.closeLoading();
					if($.validate(page))return;
					
					var radioObj ="<input class='input_fxk' name='deptradio' type='radio' value=''>";
					var fieldNames = "deptCode,deptCNname";
					var tableContent = creatTable1(fieldNames,page,radioObj);
					var tableObj = $("#deptTable");
					tableObj.find("tbody").remove();
					tableObj.append(tableContent);
					
					var strPage = creatChannelPage3(pageIndex,6,page.maxPage,"18");
					var pageDIV = $("#deptPageDIV");
					pageDIV[0].innerHTML="";
					pageDIV.append(strPage);
					
					$("#deptDiv").OpenDiv();
					
					bindradio();
				}
			});
		}

		//点击“确定” ，选择 出单机构
		function chooseDept(){
			var selectedDept= $("input[name='deptradio']:checked");
			if(selectedDept.length==0){
				$.message("error", "请选择一个出单机构");
				return;
			}
			var deptCode = selectedDept.parent().parent().children(" td:eq(1)").html();
			$('#dptCode').val(deptCode);
			
			closeCurrentDIV('deptDiv');
		}

		//------------------------------------------ 出单机构 结束----------------------------------------------
		
		//------------------------------------------ 合作伙伴 开始----------------------------------------------
		//打开合作伙伴 窗口
		function openChannelInfoDiv(pageIndex,obj){
			if(($.trim($('#privilegeBranch').val())).length==0){
				$.message('error',"请先选择机构");
				return;
			}
			$('#channelCode').val('');
			$('#channelName').val('');
			$("#"+obj.id).blur();
			queryTradPartners(pageIndex);
		}
		
		//查询 合作伙伴
		function queryTradPartners(pageIndex){
			var size = 8;
			var parentDeptCode = $.trim($('#privilegeBranch').val());
			var channelCode = $.trim($('#channelCode').val());
			var channelName = $.trim($('#channelName').val());
			
			$.openLoading();
			$.ajax({
				url : "<%=path%>/carPolicyList/queryChannelInfoOfLife",
				type : 'POST',
				async : true,
				data:{
					pageIndex:pageIndex,
					size:size,
					parentDeptCode:parentDeptCode,
					channelCode:channelCode,
					channelName:channelName
				},
				dataType:'json',
				success:function(page){
					$.closeLoading();
					if($.validate(page))return;
					
					var radioObj ="<input class='input_fxk' name='partnerradio' type='radio' value=''>";
					var fieldNames = "channelCode,channelName";
					var tableContent = creatTable1(fieldNames,page,radioObj);
					var tableObj = $("#channelInfoTable");
					tableObj.find("tbody").remove();
					tableObj.append(tableContent);
					
					var strPage = creatChannelPage2(pageIndex,6,page.maxPage,"16");
					var pageDIV = $("#channelInfoPageDIV");
					pageDIV[0].innerHTML="";
					pageDIV.append(strPage);
					
					$('#channelInfoDiv').OpenDiv();
					
					bindradio();
				}
			});
		}
		
		//点击“确定”按钮，选择合作伙伴
		function choosePartner(){
			var selectedPartner = $("input[name='partnerradio']:checked");
			if(selectedPartner.length==0){
				$.message("error", "请选择一个合作伙伴");
				return;
			}
			var selectedPartnerNo = selectedPartner.parent().parent().children(" td:eq(1)").html();
			$('#partnerNo').val(selectedPartnerNo);
			$("#subPartnerNo").val("");
			
			closeCurrentDIV('channelInfoDiv');
		}
		
		//------------------------------------------ 合作伙伴 结束----------------------------------------------
		
		//------------------------------------------ 合作伙伴子机构 开始----------------------------------------------
		//加载subChannelTree
		function openSubChannelTreeDiv(){
			var partnerNo = $.trim($('#partnerNo').val());
			if(partnerNo.length==0){
				$.message("error", "请先选择合作伙伴");
				return;
			}
			
			$.openLoading();
			$.ajax({
				url : "<%=path%>/carPolicyList/querySubChannelTree?"+new Date().getTime(),
				type : 'POST',
				async : true,
				data:{
					parentChannelCode:partnerNo
				},
				dataType:'json',
				success:function(data){
					$.closeLoading();
					if($.validate(data))return;
					
					if(data.length == 0){
						$.message("error", "所选合作伙伴下没有合作伙伴子机构");return;
					}
					var setting = {
							check: {
								enable: true,
								chkStyle: "radio",
								radioType: "all"
							},
							data: {
								simpleData: {
									enable: true
								}
							}
						};
	
					$.fn.zTree.init($("#subChannelTree"), setting, data);
					
					$("#subChannelTreeDiv").OpenDiv();
				}
			});
		}
		
		//点击“确定”按钮，选择合作伙伴子机构
		function chooseSubPartner(){
			var subChannelTree = $.fn.zTree.getZTreeObj("subChannelTree");
			if(subChannelTree.getCheckedNodes(true).length==0){
				$.message("error", "请选择一个合作伙伴子机构");
				return;
			}
			var subChannels = subChannelTree.getCheckedNodes(true);
			$("#subPartnerNo").val(subChannels[0].id);
			
			closeCurrentDIV('subChannelTreeDiv');
		}
		
		//------------------------------------------ 合作伙伴子机构 结束----------------------------------------------
		
		
		//“重置”查询条件
		function  resetCriteria(){
			$('#downloadlifePolicyFileForm input[type!="button"]').val("");
			$('#downloadlifePolicyFileForm select[name!="privilegeBranch"]').val("");
			$("#privilegeBranch").val(defaultBranch);//机构置为默认机构
		}
		function bindredio(){
			$("input[name='radioTradProdType']").click(function(){
				$("input[name='radioTradProdType']").parent().parent().removeClass("table_highlighter");
				$(this).parent().parent().addClass("table_highlighter");

		   	});
		}
		
		//点击“查询”
		function queryNocarPolicy(pageIndex){
			var downloadFlag = false;
			if(pageIndex == null){
				pageIndex = 1;
			}
			if(pageIndex == -1){
				pageIndex = 1;
				downloadFlag = true;
			}
			
			var asyncFlag = true;
			if(pageIndex == -1){
				asyncFlag = false;
			}
			
			var privilegeBranch = $.trim($("#privilegeBranch").val());//机构
			var dptCode = $.trim($("#dptCode").val());//出单机构
 			var tradProdType = $.trim($("#tradProdType").val());//产品类型
			var partnerNo = $.trim($("#partnerNo").val());//合作伙伴
			var subPartnerNo= $.trim($("#subPartnerNo").val());//合作伙伴子机构
			var licenseno= $.trim($("#orderId").val());//车牌号
			var polSubDateBegin=  $.trim($("#polSubDateBegin").val());//保单提交日期
			var polSubDateEnd=  $.trim($("#polSubDateEnd").val());
			var polBeginDateBegin=  $.trim($("#polBeginDateBegin").val());//保单生效日期
			var polBeginDateEnd=  $.trim($("#polBeginDateEnd").val());
			var polno =$.trim($("#polno").val());//保单号
			var polStatus =$.trim($("#polStatus").val());//保单状态
			
			$.openLoading();
			$.ajax({
				url : "<%=path%>/carPolicyList/queryCarPolicyPageByCriteria",
				type : 'POST',
				async : asyncFlag,
				dataType:'json',
				data:{
					pageIndex:pageIndex,
					privilegeBranch:privilegeBranch,
					dptCde:dptCode,
					tradProdType:tradProdType,
					partnerNo:partnerNo,
					partnerSubCode:subPartnerNo,
					licenseno:licenseno,
					polSubDateBegin:polSubDateBegin,
					polSubDateEnd:polSubDateEnd,
					polBeginDateBegin:polBeginDateBegin,
					polBeginDateEnd:polBeginDateEnd,
					polno:polno,
					stateId:polStatus
				},
				success:function(page){
					$.closeLoading();
					if($.validate(page))return;
					if(page.result == 'noChannelInfo'){
						//清空表格数据
						$("#nocarPolicyTable").find("tbody").remove();
						$("#nocarPolicyPageDiv").html("");
						$("#countValidPolicy").text("0");
						$("#totalPremium").text("0");

						if(downloadFlag){
							$.message("error", "导出数据为空");
						}
						return;
					}

					$("#countValidPolicy").text(page.map.countOfValid);//有效保单笔数
					$("#totalPremium").text(page.map.totalPremiumOfValid);//设置保费合计
																																
					//业务处理	
					var firstbutton ="<input class='input_fxk' name='radioTradProdType' type='radio' value='#'>";
					var fieldNames = "polno,partnerName,partnerSubName,insuPlanName,premium,insertTimeStr,beginDateStr,endDateStr,licenseno,frameno,stateId?[{'2':'承保'};{'3':'已注销'}],spical1^[{'0':'对账成功'};{'1':'对账失败'};{'':'未对账'}]";
					var tableContent = creatTable9(fieldNames,page,firstbutton,null);																			
					var tableObj = $("#nocarPolicyTable");
					tableObj.find("tbody").remove();
					tableObj.append(tableContent);
					
						
					var strPage = creatChannelPage(pageIndex,6,page.maxPage,"54");
					var pageDIV = $("#nocarPolicyPageDiv");
					pageDIV[0].innerHTML="";
					pageDIV.append(strPage); 
					
					if(downloadFlag){
						if(page.data.length == 0){
							$.message("error", "导出数据为空");
							return;
						}
						
						$("#downloadlifePolicyFileForm").attr("action","<%=path%>/carPolicyList/downloadCarPolicyFileByCriteria");
					 	$("#downloadlifePolicyFileForm").submit();
					}
					bindredio();
				}
			});
		}
		

	//点击文件下载
	function downloadlifePolicyFile(){
		queryNocarPolicy(-1);
	}

	//弹出层表格绑定单选按钮事件，选中某个单选按钮，该按钮所在行高亮显示
	function bindradio(){
		$("input[name='prodradio']").click(function(){
			$("input[name='prodradio']").parent().parent().removeClass("table_highlighter");
			$(this).parent().parent().addClass("table_highlighter");
	   	});
		$("input[name='partnerradio']").click(function(){
			$("input[name='partnerradio']").parent().parent().removeClass("table_highlighter");
			$(this).parent().parent().addClass("table_highlighter");
	   	});
		$("input[name='deptradio']").click(function(){
			$("input[name='deptradio']").parent().parent().removeClass("table_highlighter");
			$(this).parent().parent().addClass("table_highlighter");
	   	});
	}

	//统一 关闭窗口(传入要关闭DIV的id)
	function closeCurrentDIV(obj){
			$("#"+obj).CloseDiv();	
	}

	<%-- added by gzz@2015-11-3 for shen zhen you hua begin --%>
	function polNoDetailInfoHref(obj){
			var polNo = $(obj).parent('td').parent('tr')[0].childNodes[1].childNodes[0].innerHTML;
	 		var tradProdType = $(obj).parent('td').parent('tr')[0].childNodes[12].innerHTML;
	 		$(obj).parent('td').parent('tr').find("input[name='radioTradProdType']").prop("checked",true);
	 		$("input[name='radioTradProdType']").parent().parent().removeClass("table_highlighter");
	 		$(obj).parent('td').parent('tr').addClass("table_highlighter");
	 		if('1001'==tradProdType || '1002'==tradProdType || '1004'==tradProdType || '3001'==tradProdType || '3002'==tradProdType|| '3003'==tradProdType){
	 			viewDetail_singel(polNo,tradProdType);
	 		}else{
	 			$.message("error", "请求参数错误，请稍后重试！");
	 		}
	}
	function polNoDetailInfo(){
		var radioProduct = $("input[name='radioTradProdType']:checked");
		if(radioProduct.val()!=undefined){
			var polNo = $(radioProduct).parent('td').parent('tr')[0].childNodes[1].childNodes[0].innerHTML;
	 		var tradProdType = $(radioProduct).parent('td').parent('tr')[0].childNodes[12].innerHTML;
	 		if('1001'==tradProdType || '1002'==tradProdType || '1004'==tradProdType || '3001'==tradProdType || '3002'==tradProdType|| '3003'==tradProdType){
	 			viewDetail_singel(polNo,tradProdType);
	 		}else{
	 			$.message("error", "请求参数错误，请稍后重试！");
	 		}
		}else{
			$.message("error", "请选择一个保单");
		}
	}
	<%--清单下载只支持团单 --%>
	function teamBBRDownLoad(){
		var radioProduct = $("input[name='radioTradProdType']:checked");
		if(radioProduct.val()!=undefined){
			var polNo = $(radioProduct).parent('td').parent('tr')[0].childNodes[1].childNodes[0].innerHTML;
			var tradProdType = $(radioProduct).parent('td').parent('tr')[0].childNodes[12].innerHTML;
	 		if('1002'==tradProdType || '3002'==tradProdType){
	 			$.dialog({
	 				type: "warn",
	 				content: "您确定下载被保险人清单吗？",
	 				onOk: function() {
	 					$('#downLoadPolNoStr').val(polNo);
	 					document.form2.action = "<%=path%>/nocarPolicyList/downloadTeamPolicyBBRInfoFileByPolNo?"+new Date().getTime();
	 				    document.form2.submit();
	 				}
	 			});
	 		}else{
	 			$.message("error", "选择保单类型不支持清单下载，目前仅支持团单");
	 		}
		}else{
			$.message("error", "请选择一个保单");
		}
	}
	//详细信息查看
	function viewDetail_singel(polNo,tradProdType){
		$.ajax({
			url : "<%=path%>/nocarPolicyList/queryViewDetail?+"+new Date().getTime(),
			type : 'POST',
			async:true,
			dataType:'json',
			data:{polNo:polNo,tradProdType:tradProdType},
			success : function(page) {
				if($.validate(page))return;
				var data = page.obj;
				if('1001'==tradProdType || '3001'==tradProdType){
					if(data.policy_detail_Info!=null){
						$('#singel_polno').html(data.policy_detail_Info.polno);
						$('#singel_carNo').html(data.policy_detail_Info.cardNo);
						$('#singel_planDscp').html(data.policy_detail_Info.insuPlanName);
						$('#singel_insertTime').html(data.policy_detail_Info.insertTimeStr);
						$('#singel_days').html(data.policy_detail_Info.insureDays);
						$('#singel_productUnit').html(data.policy_detail_Info.productUnit);
						$('#singel_beginDate').html(data.policy_detail_Info.beginDateStr);
						$('#singel_endDate').html(data.policy_detail_Info.endDateStr);
						$('#singel_premium').html(data.policy_detail_Info.premiumFormatStr);
						$('#singel_amount').html(data.policy_detail_Info.amountFormatStr);
						$('#singel_spicalArran').html(data.policy_detail_Info.spicalArran);
					}
					if(data.syr_detail_Info!=null){
						var Page= new Object();
						Page.data  = data.syr_detail_Info;
						if('1001'==tradProdType){
							var fieldNames = "realName,certiTypeDscp,certiCode,gender?[{'1060':'未知'};{'3':'未知'};{'1061':'男'};{'1':'男'};{'1062':'女'};{'2':'女'}],birthdayStr,relaInsurerDscp,bnftProportion,bnftTurn";
							var tableContent = creatTable1(fieldNames,Page,null,null);																			
							var tableObj = $("#singel_syr_tableInfo");
							tableObj.find("tbody").remove();
							tableObj.append(tableContent);
							$('#singel_syr_tableInfo').show();
							$('#nlife_singel_syr_tableInfo').hide();
						}else if('3001'==tradProdType){
							var fieldNames = "realName,certiTypeDscp,certiCode,gender?[{'1060':'未知'};{'3':'未知'};{'1061':'男'};{'1':'男'};{'1062':'女'};{'2':'女'}],birthdayStr,relaInsurerDscp,bnftProportion";
							var tableContent = creatTable1(fieldNames,Page,null,null);																			
							var tableObj = $("#nlife_singel_syr_tableInfo");
							tableObj.find("tbody").remove();
							tableObj.append(tableContent);
							$('#nlife_singel_syr_tableInfo').show();
							$('#singel_syr_tableInfo').hide();
						}
						$('#singel_syr_fd_tableInfo').hide();
					}else{
						$('#singel_syr_fd_tableInfo').show();
						$('#singel_syr_tableInfo').hide();
						$('#nlife_singel_syr_tableInfo').hide();
					}
					if(data.bbr_detail_Info!=null){
						$('#singel_bbr_realName').html(data.bbr_detail_Info.realName);
						$('#singel_bbr_certiType').html(data.bbr_detail_Info.certiTypeDscp);
						$('#singel_bbr_birthday').html(data.bbr_detail_Info.birthdayStr);
						if('1061'== data.bbr_detail_Info.gender ||'1'==data.bbr_detail_Info.gender){
							$('#singel_bbr_gender').html("男");
						}else if('1062'== data.bbr_detail_Info.gender ||'2'==data.bbr_detail_Info.gender){
							$('#singel_bbr_gender').html("女");
						}else if('1060'== data.bbr_detail_Info.gender ||'3'==data.bbr_detail_Info.gender){
							$('#singel_bbr_gender').html("未知");
						}else{
							$('#singel_bbr_gender').html("");
						}
						$('#singel_bbr_certiCode').html(data.bbr_detail_Info.certiCode);
						$('#singel_bbr_telephone').html(data.bbr_detail_Info.mobile);
					}
					if(data.tbr_detail_Info!=null){
						$('#singel_realName').html(data.tbr_detail_Info.realName);
						$('#singel_certiType').html(data.tbr_detail_Info.certiTypeDscp);
						$('#singel_birthday').html(data.tbr_detail_Info.birthdayStr);
						if('1061'== data.tbr_detail_Info.gender ||'1'==data.tbr_detail_Info.gender){
							$('#singel_gender').html("男");
						}else if('1062'== data.tbr_detail_Info.gender ||'2'==data.tbr_detail_Info.gender){
							$('#singel_gender').html("女");
						}else if('1060'== data.tbr_detail_Info.gender ||'3'==data.tbr_detail_Info.gender){
							$('#singel_gender').html("未知");
						}else{
							$('#singel_gender').html("");
						}
						$('#singel_certiCode').html(data.tbr_detail_Info.certiCode);
						$('#singel_telephone').html(data.tbr_detail_Info.mobile);
					}
					if(data.xz_detail_Info!=undefined && data.xz_detail_Info!=null){
						var Page= new Object();
						Page.data  = data.xz_detail_Info;
						var fieldNames = "tradPlanCode,instCod,tradPlanDesc,amountFormatStr";
						var tableContent = creatTable1(fieldNames,Page,null,null);																			
						var tableObj = $("#singel_xz_tableInfo");
						tableObj.find("tbody").remove();
						tableObj.append(tableContent);
						$('#nlife_div_singel_xz_tableInfo').hide();
						$('#pre_div_singel_xz_tableInfo').show();
					}
					if(data.nlife_xz_detail_Info!=undefined && data.nlife_xz_detail_Info!=null){
						var Page= new Object();
						Page.data  = data.nlife_xz_detail_Info;
						var fieldNames = "riskName,covName,covAmtStr";
						var tableContent = creatTable1(fieldNames,Page,null,null);																			
						var tableObj = $("#nlife_singel_xz_tableInfo");
						tableObj.find("tbody").remove();
						tableObj.append(tableContent);
						$('#pre_div_singel_xz_tableInfo').hide();
						$('#nlife_div_singel_xz_tableInfo').show();
					}
					$('#policyDetailInfo').OpenDiv();
				}else if ('1002'==tradProdType || '3002'==tradProdType){
					if(data.policy_detail_Info!=null){
						$('#team_polno').html(data.policy_detail_Info.polno);
						$('#team_bbrNum').html(data.policy_detail_Info.bbrNum);
						$('#team_planDscp').html(data.policy_detail_Info.insuPlanName);
						$('#team_insertTime').html(data.policy_detail_Info.insertTimeStr);
						$('#team_days').html(data.policy_detail_Info.insureDays);
						$('#team_productUnit').html(data.policy_detail_Info.productUnit);
						$('#team_beginDate').html(data.policy_detail_Info.beginDateStr);
						$('#team_endDate').html(data.policy_detail_Info.endDateStr);
						$('#team_appContent').html(data.policy_detail_Info.appContent);
						$('#team_amount').html(data.policy_detail_Info.amountFormatStr);
						$('#team_premium').html(data.policy_detail_Info.premiumFormatStr);
						$('#team_spicalArran').html(data.policy_detail_Info.spicalArran);
					}
					if(data.xz_detail_Info!=undefined && data.xz_detail_Info!=null){
						var Page= new Object();
						Page.data  = data.xz_detail_Info;
						var fieldNames = "tradPlanDesc,amountFormatStr";
						var tableContent = creatTable1(fieldNames,Page,null,null);																			
						var tableObj = $("#team_xz_tableInfo");
						tableObj.find("tbody").remove();
						tableObj.append(tableContent);
						$('#nlife_div_team_xz_tableInfo').hide();
						$('#pre_div_team_xz_tableInfo').show();
						
					}
					if(data.nlife_xz_detail_Info!=undefined && data.nlife_xz_detail_Info!=null){
						var Page= new Object();
						Page.data  = data.nlife_xz_detail_Info;
						var fieldNames = "riskName,covName,covAmtStr";
						var tableContent = creatTable1(fieldNames,Page,null,null);																			
						var tableObj = $("#nlife_team_xz_tableInfo");
						tableObj.find("tbody").remove();
						tableObj.append(tableContent);
						$('#pre_div_team_xz_tableInfo').hide();
						$('#nlife_div_team_xz_tableInfo').show();
					}
					$('#teamPolicyDetailInfo').OpenDiv();
					
				}else if('1004'==tradProdType || '3003'==tradProdType){
					if(data.policy_detail_Info!=null){
						$('#drive_polno').html(data.policy_detail_Info.polno);
						$('#drive_carNo').html(data.policy_detail_Info.cardNo);
						$('#drive_planDscp').html(data.policy_detail_Info.insuPlanName);
						$('#drive_insertTime').html(data.policy_detail_Info.insertTimeStr);
						$('#drive_days').html(data.policy_detail_Info.insureDays);
						$('#drive_productUnit').html(data.policy_detail_Info.productUnit);
						$('#drive_beginDate').html(data.policy_detail_Info.beginDateStr);
						$('#drive_endDate').html(data.policy_detail_Info.endDateStr);
						$('#drive_premium').html(data.policy_detail_Info.premiumFormatStr);
						$('#drive_amount').html(data.policy_detail_Info.amountFormatStr);
						$('#drive_spicalArran').html(data.policy_detail_Info.spicalArran);
						$('#drive_licenseno').html(data.policy_detail_Info.licenseno);
						$('#drive_usenatureDscp').html(data.policy_detail_Info.usenatureDscp);
						$('#drive_frameno').html(data.policy_detail_Info.frameno);
						$('#drive_bbrNum').html(data.policy_detail_Info.bbrNum);
					}
					if(data.tbr_detail_Info!=null){
						$('#drive_realName').html(data.tbr_detail_Info.realName);
						$('#drive_certiType').html(data.tbr_detail_Info.certiTypeDscp);
						$('#drive_address').html(data.tbr_detail_Info.address);
						$('#drive_certiCode').html(data.tbr_detail_Info.certiCode);
						$('#drive_telephone').html(data.tbr_detail_Info.telephone);
					}
					if(data.xz_detail_Info!=null){
						var Page= new Object();
						Page.data  = data.xz_detail_Info;
						var fieldNames = "tradPlanDesc,amountFormatStr";
						var tableContent = creatTable1(fieldNames,Page,null,null);																			
						var tableObj = $("#drive_xz_tableInfo");
						tableObj.find("tbody").remove();
						tableObj.append(tableContent);
						$('#nlife_div_drive_xz_tableInfo').hide();
						$('#pre_div_drive_xz_tableInfo').show();
					}
					if(data.nlife_xz_detail_Info!=undefined && data.nlife_xz_detail_Info!=null){
						var Page= new Object();
						Page.data  = data.nlife_xz_detail_Info;
						var fieldNames = "riskName,covName,covAmtStr";
						var tableContent = creatTable1(fieldNames,Page,null,null);																			
						var tableObj = $("#nlife_drive_xz_tableInfo");
						tableObj.find("tbody").remove();
						tableObj.append(tableContent);
						$('#pre_div_drive_xz_tableInfo').hide();
						$('#nlife_div_drive_xz_tableInfo').show();
					}
					$('#drivePolicyDetailInfo').OpenDiv();
				}else{
					$.message("error", "请求参数错误，请稍后重试！");
				}
			}
		});
	}
	<%-- added by gzz@2015-11-3 for shen zhen you hua end --%>
	</script>
	
	</head>
	<body>
	<form method="POST" name="form2">
	<input type="hidden" name="polNo" id="downLoadPolNoStr">
	</form>
 	 <div class="current">
           <table class="current_table_1">
             <tbody>
              	<tr class="f2">
	                <td><img src="./images/current_1.jpg"></td>
	                <td class="current_table_1_td">
	                  <img src="images/current_1.png">&nbsp;您现在的位置：&nbsp;
	                  <span style=" color:#136bab; ">统计分析
	                  	<span style="padding:0 5px; font-weight:bold; line-height:28px;">&gt;</span>车险保单查询
	                  </span>
                  	</td>
                 	<td><img src="./images/current_3.jpg"></td>
              	</tr>
           	 </tbody>
           </table>
     </div>
       
       <!--查询条件及结果表单 -->
        <table border="1" class="table_02" style="height:150px">
	  		<tr height="50px">
	  			<td colspan="2" align="center">
	  				<form method="post" id="downloadlifePolicyFileForm"> 
						<table border="0" style="margin: 12px auto;">
							<tr>
								<td style="padding-left:40px; border: 0;text-align: right" nowrap="nowrap">机构：</td>
								<td style="border: 0;text-align: left;padding-right: 70px">
								   <select class="search_select_1" name="privilegeBranch" id="privilegeBranch" onchange="clearBranchRelaField()" style="width: 206px"></select>
								</td>
								<td style="padding-left:40px;border: 0;text-align: right" nowrap="nowrap">出单机构：</td>
		                  		<td style="border: 0;text-align: left;padding-right: 70px"><input id="dptCode" name="dptCde" type="text" readonly="readonly" style=" background-color: #ccc;" class="input_text">&nbsp;&nbsp;<input type="button"  class="input_button_5" id="searchDeptBtn" value="请选择" onClick="openDeptDiv(1,this)"/></td>
								<td style="border: 0;text-align: right;" nowrap="nowrap">产品：</td>
								<td style="border: 0;text-align: left;padding-right: 70px">
									<select id="tradProdType" name="tradProdType" class="search_select_1">
										<option value="JQ">交强</option>
										<option value="SY">商业</option>
									</select>
								</td>
							</tr>
							<tr>
								<td style="border: 0;text-align: right" nowrap="nowrap">合作伙伴：</td>
		                        <td style="border: 0 ;text-align: left; padding-right: 70px"><input name="partnerNo" id="partnerNo" readonly="readonly" onselect="" style=" background-color: #ccc;" class="input_text">&nbsp;&nbsp;<input type="button"  class="input_button_5"  id="searchPartnerBtn" value="请选择" onClick="openChannelInfoDiv(1,this)"/></td>
								<td style="border: 0;text-align: right" nowrap="nowrap">合作伙伴子机构：</td>
		                        <td style="border: 0 ;text-align: left; padding-right: 70px"><input name="partnerSubCode" id="subPartnerNo" readonly="readonly" style=" background-color: #ccc;" class="input_text">&nbsp;&nbsp;<input type="button"  class="input_button_5"  id="searchSubPartnerBtn" value="请选择" onClick="openSubChannelTreeDiv()"/></td>
								<td style="border: 0;text-align: right;" nowrap="nowrap">车牌号：</td>
								<td style="border: 0;text-align: left;padding-right: 70px">
									<input name="orderId" id="orderId" class="input_text" style="width:130px;" size="25"/>
								</td>
							</tr>
							<tr>
								<td style="border: 0;text-align: right;" nowrap="nowrap">保单提交日期：</td>
								<td style="border: 0;text-align: left;padding-right: 70px">
									 <input id="polSubDateBegin" name="polSubDateBegin" readonly="readonly" onclick="showCalendar('polSubDateBegin','y-mm-dd');"  class="input_time"/>
								</td>
								<td style="border: 0;text-align: right;" nowrap="nowrap">至：</td>
								<td style="border: 0;text-align: left;padding-right: 70px">
									 <input id="polSubDateEnd" name="polSubDateEnd" readonly="readonly" onclick="showCalendar('polSubDateEnd','y-mm-dd');"  class="input_time"/>
								</td>
								<td style="border: 0;text-align: right;" nowrap="nowrap">保单号：</td>
								<td style="border: 0;text-align: left;padding-right: 70px">
									<input name="polno" id="polno" class="input_text" style="width:130px;" size="25"/>
								</td>
							</tr>
							<tr>
								<td style="border: 0;text-align: right;" nowrap="nowrap">保单生效日期：</td>
								<td style="border: 0;text-align: left;padding-right: 70px">
									 <input id="polBeginDateBegin" name="polBeginDateBegin" readonly="readonly" onclick="showCalendar('polBeginDateBegin','y-mm-dd');"  class="input_time"/>
								</td>
								<td style="border: 0;text-align: right;" nowrap="nowrap">至：</td>
								<td style="border: 0;text-align: left;padding-right: 70px">
									 <input id="polBeginDateEnd" name="polBeginDateEnd" readonly="readonly" onclick="showCalendar('polBeginDateEnd','y-mm-dd');"  class="input_time"/>
								</td>
								<td style="border: 0;text-align: right;" nowrap="nowrap">保单状态：</td>
								<td style="border: 0;text-align: left;padding-right: 70px">
								   <select class="search_select_1" name="stateId" id="polStatus">
										<option value="">---请选择---</option>								   		
<!-- 								   		<option value="0">试算</option> -->
<!-- 								   		<option value="1">核保通过</option> -->
								   		<option value="2">承保</option>
								   		<option value="3">已注销</option>
								   </select>
								</td>
							</tr>
							<tr>
								<td colspan="6" style="border: 0;padding-top: 5px;padding-right: 70px">
									<input type="button"  class="input_button_1"  value="查询"    onClick="queryNocarPolicy()"/>
								   	<input type="button"  class="input_button_1"  value="重置"    onClick="resetCriteria()"/>
								</td>
							</tr>
						</table>	  				
				    </form>
				</td>
	  		</tr>
	  		<tr>
	  			<td valign="top">
		  			<div id="nocarPolicyDiv" style="width:98%;margin:5px" >
		  				<div align="left" style="margin:15px">
			  				<input type="button"  class="input_button_2"  value="导出Excel" onClick="downloadlifePolicyFile()"/>&nbsp;
<!-- 			  				<input type="button"  class="input_button_2"  value="详细信息" onClick="polNoDetailInfo()"/>&nbsp; -->
<!-- 			  				<input type="button"  class="input_button_2"  value="清单下载" onClick="teamBBRDownLoad()"/>&nbsp; -->
							<div align="right" style="margin:15px">
								<span>有效保单笔数：</span><span id="countValidPolicy" style="color: red">0</span>笔&nbsp;&nbsp;
								<span>含税保费合计：</span><span id="totalPremium" style="color: red">0</span>元
							</div>
				  		</div>
				  		<table class="table_02" id="nocarPolicyTable">
					  		<thead>
				               <tr>
				               	  <th style="width:4%" nowrap="nowrap">选择</th>
				                  <th style="width:12%" nowrap="nowrap">保单号</th>
				                  <th style="width:8%" nowrap="nowrap">合作伙伴</th>
				                  <th style="width:9%" nowrap="nowrap">合作伙伴子机构</th>
				                  <th style="width:8%" nowrap="nowrap">投保方案</th>
				                  <th style="width:6%" nowrap="nowrap">含税保费</th>
				                  <th style="width:9%" nowrap="nowrap">保单提交日期</th>
				                  <th style="width:7%" nowrap="nowrap">起保日期</th>
				                  <th style="width:7%" nowrap="nowrap">终保日期</th>
				                  <th style="width:6%" nowrap="nowrap">车牌号</th>
				                  <th style="width:10%" nowrap="nowrap">车架号</th>
				                  <th style="width:5%" nowrap="nowrap">状态</th>
				                  <th style="width:8%" nowrap="nowrap">业务对账标识</th>
				              	</tr>
				              </thead>
			              <tbody>
						  </tbody>
			            </table>
		  				 <div id="nocarPolicyPageDiv"  class="page"></div>
		  			</div>
	  			</td>
	  		</tr>
	  	</table>
       
    <!--选择出单机构 DIV 默认隐藏-->
	<div id="deptDiv" style="display:none;width:80%;">
<!--   		<input type="hidden" id="row_num" name="row_num" value="0"/> -->
		<div class="table_title_div">
			<table class="table_title" style='width:100%;height: 20px;'>
				<tr>
				<td width="10%"></td>
				<td width="80%" id="interfaceName"></td>
				<td width="10%" align="right"><img src="./images/closedown.gif" alt="关闭"  onclick="closeCurrentDIV('deptDiv')"/></td>
				</tr>
			</table>
		</div>
		<table class="table_02" id="table" style="height:180px;" align="center">
			<tr>
				<td>
					<table class="search_table">
						<tr height="30px">
							<td colspan="3" style="text-align:center">
							 出单机构代码：<input name="txt3"  id="deptCode"  type="text" class="input_text" value="" >&nbsp;&nbsp;
							 出单机构名称：<input name="txt3" id="deptCname"  type="text" class="input_text" value="">
								       <input type="button"  class="input_button_1" id="searchBtn" value="查询" onClick="queryCoreDept(1)"/>
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td>
					<table id="deptTable"  class="content_table_1">
						<thead>
							<tr class="f1">
			                  <th style="width:5%">选择</th>
			                  <th style="width:40%">出单机构代码</th>
			                  <th style="width:55%">出单机构名称</th>
			              	</tr>
						</thead>
						<tbody>
						</tbody>
					</table>
					<div id="deptPageDIV"  class="page"></div>
				</td>
			</tr>
		</table>
		<div align="center" >
		  <input type="button" id="saveRoleBtn" value="确定" onclick="chooseDept()" class="input_button_3"/>&nbsp;&nbsp;&nbsp;
		  <input type="button" value="取消" onclick="closeCurrentDIV('deptDiv')" class="input_button_3"/>
		</div>
	</div>
       
    <!--选择 合作伙伴 div 默认隐藏-->
  	<div id="channelInfoDiv" style="display:none;width:80%;">
		<div class="table_title_div">
			<table class="table_title" style='width:100%;height: 20px;'>
				<tr>
				<td width="10%"></td>
				<td width="80%" id="interfaceName"></td>
				<td width="10%" align="right"><img src="./images/closedown.gif" alt="关闭"  onclick="closeCurrentDIV('channelInfoDiv')"/></td>
				</tr>
			</table>
		</div>
		<table class="table_02" id="table" style="height:180px;" align="center">
			<tr>
				<td>
					<table class="search_table">
						<tr height="30px">
							<td colspan="3" style="text-align:center">
							 合作伙伴代码：<input name="txt3"  id="channelCode"  type="text" class="input_text" value="" >&nbsp;&nbsp;
							 合作伙伴名称：<input name="txt3" id="channelName"  type="text" class="input_text" value="">&nbsp;&nbsp;
								       <input type="button"  class="input_button_1" id="searchBtn" value="查询" onClick="queryTradPartners(1)"/>
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td>
					<table id="channelInfoTable"  class="content_table_1">
						<thead>
							<tr class="f1">
			                  <th style="width:5%">选择</th>
			                  <th style="width:10%">合作伙伴代码</th>
			                  <th style="width:20%">合作伙伴名称</th>
			              	</tr>
						</thead>
						<tbody>
						</tbody>
					</table>
					<div id="channelInfoPageDIV"  class="page"></div>
				</td>
			</tr>
		</table>
		<div align="center" >
		  <input type="button" id="saveRoleBtn" value="确定" onclick="choosePartner()" class="input_button_3"/>&nbsp;&nbsp;&nbsp;
		  <input type="button" value="取消" onclick="closeCurrentDIV('channelInfoDiv')" class="input_button_3"/>
		</div>
	</div>
	
	<%--subChannelTree(选择合作伙伴子机构层) --%>
    <div id="subChannelTreeDiv" style="display: none;width:500px;margin-top: -50px" align="center">
    	<div class="table_title_div">
			<table class="table_title" style='width:500px; height: 20px;'>
				<tr>
					<td width="10%"></td>
					<td width="80%" id="interfaceName"></td>
					<td width="10%" align="right"><img src="<%=path %>/images/closedown.gif" alt="关闭"  onclick="closeChannelTreeDiv()"/></td>
				</tr>
			</table>
		</div>
		
		<div style="height: 300px;width:500px; overflow:auto">
			<ul id="subChannelTree" class="ztree"></ul>
		</div>
		
		<div style="text-align: center;padding: 5px">
			<input type="button" id="choseChannelBtn" value="确定" onclick="chooseSubPartner()" class="input_button_1"/>&nbsp;&nbsp;&nbsp;
			<input type="button" value="取消" onclick="closeCurrentDIV('subChannelTreeDiv')" class="input_button_1"/>
		</div>
	</div>
	
	</body>
</html>
